
package cfar.ff.interfaces;


/**
 * Lazy or strict sequence of objects
 * @author badi
 */
public interface Sequence<S, A> extends Pointed<S, A>, From<S, A>, Empty<S,A>, Iterable<A>, Serializable
{
    /**
     * Add an element to the front
     * @param a
     * @return
     */
    public Sequence<S, A> cons(A a);


    /**
     * Add an element to the back
     * @param a
     * @return
     */
    public Sequence<S, A> snoc(A a);


    /**
     * @return the first element
     */
    public A head();


    /**
     * @return the sequence minus the head
     */
    public Sequence<S, A> tail();

    /**
     *
     * @return number elements in the sequence
     */
    public int length();

    public Sequence<S, A> shuffle();


    public A last();

    public boolean equals(Object other);

}
